|
|
|
|
|
|
|
DoEvents
Wend
MsgBox "Done!"
End Sub |
|
|
|
|
|
|
|
|
The code in Listing 33.5 uses the Internet Transfer control to perform three FTP commands: |
|
|
|
|
|
|
|
|
pwdPrints the current working directory on the remote machine |
|
|
|
|
|
|
|
|
dirLists files on the remote machine |
|
|
|
|
|
|
|
|
getDownloads a file from the remote machine to the client machine |
|
|
|
|
|
|
|
|
Notice that after each of these commands we use a While loop to determine if the Internet control has finished executing the command before attempting to executing a new command. The code in the StateChanged event should cause the responses from the pwd and dir commands to be printed on the form. The final command, get, transfers a text file from the FTP server to the local hard drive. This example could be used for performing automated data retrieval from a remote system, or pulling a daily weather map or other image from your favorite Web site. |
|
|
|
|
|
|
|
|
In this chapter, we have given you a small taste of a few Internet topics outside of the usual Web arena. The best place to learn about the Internet is of course on the Internet, but if you want to find out more about the Visual Basic concepts used in this chapter see the following other chapters: |
|
|
|
|
|
|
|
|
If you want to learn the basics of using the Windows API, see Chapter 20, ''Accessing the Windows API." |
|
|
|
|
|
|
|
|
To learn more about INI and text files, see Chapter 21, "Working with Files." |
|
|
|
|
|
|
|
|
To find out about controlling other OLE interfaces like Active Messaging, see Chapter 22, "Using OLE to Control Other Applications." |
|
|
|
|
|